/*
 * @Author: your name
 * @Date: 2021-07-28 15:01:09
 * @LastEditTime: 2021-07-28 15:05:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \poorlist\src\utils\filterRoute.js
 */
export const filterRouter=(AllRouter,userinfo)=>{
     //AllRouter   需要被筛选的路由，所有的路由
     //userinfo    当前登录者的身份;
     const res = AllRouter.filter(item=>{
         return item.meta.author.indexOf(userinfo) !==-1
     })
     res.length>0&&res.forEach(item=>{
          if(item.children){
              filterRouter(item.children,userinfo)
          }
     })
    //此时此刻这个res就是符合当前身份的路由表;
     return res;
}